from math import factorial
from re import X
from functools import reduce


def countdown(N):
    if N == 0:
        print('stop')
    else:
        print(N, end=' ')
        return countdown(N-1)


def countdown2(N):
    if N == 0:
        yield 'stop'
    else:
        yield N
        for x in countdown2(N-1):
            yield x


def fact0(n):
    if n == 0:
        return 1
    else:
        return fact0(n-1)*n


def fact1(n):
    return n if n == 1 else n * fact1(n-1)


def fact2(n):
    return reduce(lambda x, y: x*y, range(1, n+1))


def fact3(n):
    result = 1
    for i in range(1, n+1):
        result *= i
    return result


def fact4(n):
    return factorial(n)
